{% extends "page.html" %}

{% block content %}

{% if hisok %}

<!-- {{{ msg -->
<div class="msg">
	<div class="msg-default msg-tips">
		<i class="msg-icon"></i>
        <div class="msg-content">您最近一次在 <em>{{history.time}}</em> 进行了 <em>{%if history.m == 1 %}启用{% else %} 禁用{%endif%}</em> 操作，本次操作成功 <em>{{history.suc}}</em> 个，失败 <em>{{history.fail}}</em> 个。以下为详细操作记录：</div>
	</div>
</div>
<!-- msg }}} -->

<div class="grid">
    <table class="table">
        <colgroup>
            <col width="500">
            <col width="150">
            <col width="250">
        </colgroup>
        <thead>
            <tr class="row">
                <th>宝贝名称</th>
                <th>更新时间</th>
                <th>操作结果</th>
            </tr>
        </thead>
        <tbody>
            {%for d in details %}
            <tr class="row">
                <td><a href="http://item.taobao.com/item.htm?id={{d.num_iid}}" target="_blank">{{d.title}}</a></td>
                <td>
                    {{ d.time }}
                </td>
                <td>
                    {% if d.r == '成功' %}
                        {{ d.r }}
                    {% else %}
                        <em>{{ d.r }}</em>
                    {% endif %}
                </td>
            </tr>
            {%endfor%}
        </tbody>
    </table>
</div>

<!-- {{{ pagination -->
<div class="pagination pagination-normal">
    <div class="pagination-wrapper">
        <span class="info">共{{page.page}}页/ {{page.amount}}条</span>
        {% if page.start == 1 %}
        <span class="start">首页</span>
        <span class="prev">上一页</span>
        {% else %}
        <a class="start" href="?start=0">首页</a>
        <a class="prev" href="?start={{page.prev1}}">上一页</a>
        {% endif %}
        
        {% if page.next4 < 1 %}
        {% if page.prev4 > 0 %}
            <a class="page" href="?start={{page.prev4}}">{{page.prev4}}</a>
        {% endif %}    
        {% endif %}
        
        {% if page.next2 < 1 %}
        {% if page.prev4 > 0 %}
            <a class="page" href="?start={{page.prev4}}">{{page.prev4}}</a>
        {% endif %}    
        {% endif %}
        
        {% if page.prev2 > 0 %}
            <a class="page" href="?start={{page.prev2}}">{{page.prev2}}</a>
        {% endif %}  

        {% if page.prev1 > 0 %}
            <a class="page" href="?start={{page.prev1}}">{{page.prev1}}</a>
        {% endif %} 
        
        <span class="page">{{page.start}}</span>
        
        {% if page.next1 > 0 %}
            <a class="page" href="?start={{page.next1}}">{{page.next1}}</a>
        {% endif %} 
        
        {% if page.next2 > 0 %}
            <a class="page" href="?start={{page.next2}}">{{page.next2}}</a>
        {% endif %} 
        
        {% if page.prev2 < 1 %}
        {% if page.next3 > 0 %}
            <a class="page" href="?start={{page.next3}}">{{page.next3}}</a>
        {% endif %}    
        {% endif %}
        
        {% if page.prev1 < 1 %}
        {% if page.next4 > 0 %}
            <a class="page" href="?start={{page.next4}}">{{page.next4}}</a>
        {% endif %}    
        {% endif %}
        
        {% if page.start == page.page %}
        <span class="next">下一页</span>
        <span class="end">末页</span>
        {% else %}
        <a class="next" href="?start={{page.next1}}">下一页</a>
        <a class="end" href="?start={{page.page}}">末页</a>
        {% endif %}
    </div>
</div>
<!-- pagination }}} -->

{% else %}

<!-- {{{ msg -->
<div class="msg">
	<div class="msg-default msg-tips">
		<i class="msg-icon"></i>
        <div class="msg-content">您还没有启用过我们的服务，请<a href="index.html">返回首页</a>启用。</div>
	</div>
</div>
<!-- msg }}} -->

{% endif %}

{% endblock %}
